package andreafrancia.util.remote;

import java.rmi.Remote;
import java.rmi.RemoteException;

/**
 * A remote interface to access to a list.
 * @param <T> the type of the element managed by the list.
 * @author Andrea Francia
 */
public interface RemoteList<T> extends Remote {
    /**
     * Returns the element at the specified position in this list.
     *
     * @param index index of the element to return
     * @return the element at the specified position in this list
     * @throws IndexOutOfBoundsException if the index is out of range
     * @throws java.rmi.RemoteException if a connection problem occours.
     */
    T get(int index) throws RemoteException;
    
    
    /**
     * Returns the number of elements in this list.
     * @return the number of elements in this list
     * @throws RemoteException if a connection problem occours.
     */
    int size() throws RemoteException;
}
